package com.demo.minicat;

import java.io.*;

/**
 * @author: lipan
 * @date: 2021/9/28 19:35
 */

public class Request {

    //请求的方式 get/post
    private String method;

    //资源路径
    private String uri;



    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public Request(InputStream inputStream) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
        String line = br.readLine();
        String[] arr = line.split(" ");
        String htmlpath = arr[1].substring(1);
        this.uri = htmlpath;
        this.method=arr[0];
    }
}